package com.sjdang.springcloud.learning.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/learning/nacos/provider")
public class NacosProviderController {
	
	private Logger log = LoggerFactory.getLogger(this.getClass());
	
	@Value("${server.port}")
	private String port;
	
	@GetMapping("/hello")
	public String sayHello(@RequestParam(value="name", defaultValue="Nacos")String name) {
		log.info("nacos-provider is called  ");
		return "Hi " + name + ", I am from port:" + port;
	}
	
}
